![]() |
PBHSetVolAsync |
||||
Header: | Files.h | Carbon status: | Supported | |
Sets both the default volume and the default directory.
OSErr PBHSetVolAsync ( WDPBPtr paramBlock );
A pointer to a working directory parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion function.
On output, the result code of the function.
On input, a pointer to a pathname.
On input, a volume reference number or a working directory reference number.
On input, the directory ID of the default directory.
The PBHSetVolAsync function sets the default volume and directory to the volume and directory specified by the ioNamePtr, ioVRefNum, and ioWDDirID fields.
The PBHSetVolAsync function sets the default volume to the volume specified by the ioVRefNum field, which can contain either a volume reference number or a working directory reference number. If the ioNamePtr field specifies a full pathname, however, the default volume is set to the volume whose name is contained in that pathname. (A full pathname overrides the ioVRefNum field.)
The PBHSetVolAsync function also sets the default directory. If the ioVRefNum field contains a volume reference number, then the default directory is set to the directory on that volume having the partial pathname specified by ioNamePtr in the directory specified by ioWDDirID. If the value of ioNamePtr is NULL, the default directory is simply the directory whose directory ID is contained in ioWDDirID.
If the ioVRefNum field contains a working directory reference number, then ioWDDirID is ignored and the default directory is set to the directory on that volume having the partial pathname specified by ioNamePtr in the directory specified by the working directory reference number. If the value of ioNamePtr is NULL, the default directory is simply the directory specified in ioVRefNum.
Both the default volume and the default directory are used in calls made with no volume name, a volume reference number of 0, and a directory ID of 0.
Use of the PBHSetVolAsync function is discouraged if your application may execute in system software versions prior to version 7.0. Because the specified directory might not itself be a working directory, PBHSetVolAsync records the default volume and directory separately, using the volume reference number of the volume and the actual directory ID of the specified directory. Subsequent calls to PBGetVolAsync
) return only the volume reference number, which will cause that volume’s root directory (rather than the default directory, as expected) to be accessed.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)